<HTML><HEAD><TITLE>set_prompt(+InStream, +Prompt, +OutStream)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>set_prompt(+InStream, +Prompt, +OutStream)</H1>
The prompt Prompt is output on the stream OutStream for input to the input
stream InStream.


<DL>
<DT><EM>InStream</EM></DT>
<DD>Integer (stream number) or Atom (reserved or user-defined                symbolic stream name).
</DD>
<DT><EM>Prompt</EM></DT>
<DD>String or atom.
</DD>
<DT><EM>OutStream</EM></DT>
<DD>Integer (stream number) or Atom (reserved or user-defined                symbolic stream name).
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>
   The prompt Prompt is output on the stream OutStream for input to the
   input stream InStream.

<P>
   When new data is to be read from an input stream, the system prints on
   the specified output stream a prompt, to notify the user for input.

<P>
   InStream and OutStream can be symbolic stream names (atom) or physical
   stream numbers (integer).

<P>
   InStream must be an existing stream open in read or update mode.
   OutStream must be an existing stream open in write or update mode.

<P>
   Note that the prompt for toplevel-input printed by the system at the end
   of each query is made using the predicate toplevel-prompt/1 and not by
   using the string set by set_prompt/3.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>set_prompt(+, +, +) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>One or more of InStream, Prompt or OutStream are not    instantiated.
<DT><EM>(5) type error </EM>
<DD>Either InStream or OutStream (or both) is neither an atom    nor an integer.
<DT><EM>(5) type error </EM>
<DD>Prompt is neither an atom nor a string.
<DT><EM>(192) illegal stream mode </EM>
<DD>InStream is in write mode.
<DT><EM>(192) illegal stream mode </EM>
<DD>OutStream is in read mode.
</DL>
<H2>Examples</H2>
<PRE>
Success:
  [eclipse]: get_prompt(input,_,Out),
  &gt; set_prompt(input,"myprompt&gt; ",Out).
  Out = 1
  yes.
  [eclipse]: get_prompt(input,Prompt,_),
  myprompt&gt; !.
  Prompt = "myprompt&gt; "
  yes.

  [eclipse]: read( input,X).
  &gt; a.
  X = a
  yes.
  [eclipse]: set_prompt(input, "Enter a term: ", output).
  yes.
  [eclipse]: read(input,X).
  Enter a term: a.
  X = a
  yes.

  [eclipse]: get_stream(debug_input,S),
  &gt; set_prompt(S, "   DEBUG: ", 1).
  S = 3
  yes.
  [eclipse]: trace.
  yes.
  [eclipse]: length([a,b],N).
  S (1) 0  CALL   length([a, b], _g52)   DEBUG: creep
  S (1) 0  EXIT   length([a, b], 2)   DEBUG: creep
  N = 2
  yes.


Error:
  set_prompt(4, Prompt, 1).        (Error 4).
  set_prompt(4, 4, 1).             (Error 5).
  set_prompt(output, "p&gt; ", Stream). (Error 192).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/iostream/set_stream_property-3.html">set_stream_property / 3</A>, <A HREF="../../kernel/obsolete/get_prompt-3.html">get_prompt / 3</A>
</BODY></HTML>
